/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PanelTodosArchivo.java
 *
 * Created on 30/06/2011, 12:17:19 AM
 */

package interfaz;

import java.util.ArrayList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

/**
 *
 * @author DMHA
 */
public class PanelTodosArchivo extends javax.swing.JPanel {


    PanelArchivo matriz[][];
    JPanel miPanel;

    /** Creates new form PanelTodosArchivo */
    public PanelTodosArchivo(ArrayList<String> misArchivos,VentanaPrincipal miVP) {
        initComponents();

        matriz=new PanelArchivo[3][3];
        miPanel=new JPanel();
        
//        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(miPanel);
        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(this);
        //miPanel.setLayout(jPanel1Layout);
        this.setLayout(jPanel1Layout);
        

        //miPanel.setBounds(0, 0, 900, 900);

        int x= (int) Math.ceil(misArchivos.size()/3.0);

        this.setPreferredSize(new java.awt.Dimension(500, 190*x));

        x=0;

        for (int i=0; i < matriz.length; i++) {
            for (int j = 0; j < matriz[i].length && x<misArchivos.size(); j++) {
                
            matriz[i][j]=new PanelArchivo(misArchivos.get(x),miVP);
            x++;
            matriz[i][j].setBounds((230*j)+5,(200*i)+5, 150, 220);
            this.add(matriz[i][j]);
            }

        }
        miVP.getContenedor().setViewportView(this);
        //jScrollPane1.setViewportView(miPanel);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setPreferredSize(new java.awt.Dimension(900, 900));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 582, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 398, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables

}
